﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Main.Master" AutoEventWireup="true"
    CodeBehind="Update.aspx.cs" Inherits="VirtualOrg.Web.FormUpdateUser" %>

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
    <script type="text/javascript">
        $(function () {
            $("#MainContent_txtBirthday").datepicker({
                changeMonth: true,
                changeYear: true
            });
        });

        $(function () {
            $("#accordion").accordion();
        });

        function validatePersonalInfo() {
            if (jQuery('#form1').validationEngine('validate') == false) {
                return false;
            }
            else {
                return true;
            }
        }
    </script>
    <table>
        <tr>
            <td style="vertical-align: top;">
                <div class="left">
                    <div class="thirds">
                        <div class="smallboxtop">
                        </div>
                        <div class="smallbox">
                            <a href="../User/UpdatePhoto.aspx">Update profile photo</a><br />
                            <br />
                            <img id="imgProfilePic" style="width: 180px; height: 200px;" runat="server" /><br />
                        </div>
                    </div>
                </div>
            </td>
            <td>
                <h2 id="lblTitle" runat="server">
                </h2>
                <hr />
                <div id="accordion">
                    <h3>
                        <a href="#">Personal Info</a></h3>
                    <div style="width: 650px">
                        <asp:UpdatePanel ID="pnlUpdatePersonalInfo" runat="server" UpdateMode="Conditional">
                            <ContentTemplate>
                                <table style="height: 250px;">
                                    <tr>
                                        <td>
                                            <span class="spancls">Name:</span>
                                        </td>
                                        <td>
                                            <asp:TextBox ID="txtName" runat="server" CssClass="validate[required] input_field ui-corner-all"></asp:TextBox>
                                        </td>
                                        <td style="width: 15px">
                                            &nbsp;
                                        </td>
                                        <td>
                                            <label for="email">
                                                Email:</label>
                                        </td>
                                        <td>
                                            <asp:TextBox ID="txtEmail" runat="server" CssClass="input_field ui-corner-all" Enabled="false"></asp:TextBox><br />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <label for="author">
                                                Birthday:</label>
                                        </td>
                                        <td>
                                            <asp:TextBox ID="txtBirthday" runat="server" ReadOnly="true" CssClass="validate[required] input_field ui-corner-all"></asp:TextBox>
                                        </td>
                                        <td style="width: 15px">
                                            &nbsp;
                                        </td>
                                        <td>
                                            <label for="email">
                                                Sex:</label>
                                        </td>
                                        <td>
                                            <asp:DropDownList ID="ddlSex" CssClass="validate[required] select_field ui-corner-all"
                                                runat="server">
                                                <asp:ListItem></asp:ListItem>
                                                <asp:ListItem>Male</asp:ListItem>
                                                <asp:ListItem>Female</asp:ListItem>
                                            </asp:DropDownList>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <label for="author">
                                                Country:</label>
                                        </td>
                                        <td>
                                            <asp:DropDownList ID="ddlCountry" CssClass="validate[required] select_field ui-corner-all"
                                                runat="server">
                                                <asp:ListItem></asp:ListItem>
                                                <asp:ListItem>India</asp:ListItem>
                                                <asp:ListItem>China</asp:ListItem>
                                            </asp:DropDownList>
                                        </td>
                                        <td style="width: 15px">
                                            &nbsp;
                                        </td>
                                        <td>
                                            <label for="email">
                                                Location:</label>
                                        </td>
                                        <td>
                                            <asp:TextBox ID="txtLocation" runat="server" CssClass="input_field ui-corner-all"></asp:TextBox>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <span class="spancls">Contact Number:</span>
                                        </td>
                                        <td>
                                            <asp:TextBox ID="txtContact" runat="server" CssClass="input_field ui-corner-all"></asp:TextBox>
                                        </td>
                                        <td style="width: 15px">
                                            &nbsp;
                                        </td>
                                        <td>
                                            <label for="email">
                                                Alternate Email:</label>
                                        </td>
                                        <td>
                                            <asp:TextBox ID="txtAlternateEmail" runat="server" CssClass="validate[custom[email]] input_field ui-corner-all"></asp:TextBox><br />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <span class="spancls">Overview:</span>
                                        </td>
                                        <td colspan="5">
                                            <asp:TextBox ID="txtOverview" runat="server" TextMode="MultiLine" CssClass="input_field ui-corner-all"
                                                Width="510px" Height="70px"/>
                                        </td>
                                        
                                    </tr>
                                    <tr>
                                        <td colspan="5">
                                        </td>
                                    </tr>
                                </table>
                            </ContentTemplate>
                            <Triggers>
                                <asp:AsyncPostBackTrigger ControlID="btnUpdatePersonalInfo" EventName="Click" />
                            </Triggers>
                        </asp:UpdatePanel>
                        <asp:Button ID="btnUpdatePersonalInfo" runat="server" OnClientClick="return validatePersonalInfo();"
                            Text="Update" Style="float: right;" OnClick="btnUpdatePersonalInfo_Click" />
                    </div>
                    <h3>
                        <a href="#">Work Experience</a></h3>
                    <div style="width: 650px;">
                        <asp:UpdatePanel ID="pnlUpdateWorkExperience" runat="server" UpdateMode="Conditional">
                            <ContentTemplate>
                                <table>
                                    <tr>
                                        <td>
                                            <label>
                                                Total Exp.</label>
                                        </td>
                                        <td>
                                            <asp:DropDownList ID="ddlExpYears" CssClass="select_field ui-corner-all" runat="server">
                                            </asp:DropDownList>
                                        </td>
                                        <td>
                                            <asp:DropDownList ID="ddlExpMonths" CssClass="select_field ui-corner-all" runat="server">
                                                <asp:ListItem>Months</asp:ListItem>
                                                <asp:ListItem>1</asp:ListItem>
                                                <asp:ListItem>2</asp:ListItem>
                                                <asp:ListItem>3</asp:ListItem>
                                                <asp:ListItem>4</asp:ListItem>
                                                <asp:ListItem>5</asp:ListItem>
                                                <asp:ListItem>6</asp:ListItem>
                                                <asp:ListItem>7</asp:ListItem>
                                                <asp:ListItem>8</asp:ListItem>
                                                <asp:ListItem>9</asp:ListItem>
                                                <asp:ListItem>10</asp:ListItem>
                                                <asp:ListItem>11</asp:ListItem>
                                                <asp:ListItem>12</asp:ListItem>
                                            </asp:DropDownList>
                                        </td>
                                        <td>
                                            &nbsp;&nbsp;&nbsp;
                                            <asp:LinkButton ID="lnkUpdateExp" CssClass="link" runat="server" OnClick="lnkUpdateExp_Click">Update</asp:LinkButton>
                                        </td>
                                    </tr>
                                </table>
                            </ContentTemplate>
                            <Triggers>
                                <asp:AsyncPostBackTrigger ControlID="lnkUpdateExp" EventName="Click" />
                            </Triggers>
                        </asp:UpdatePanel>
                        <h4>
                            Add Workplace</h4>
                        <asp:UpdatePanel ID="pnlAddCompany" runat="server" UpdateMode="Always">
                            <ContentTemplate>
                                <table>
                                    <tr>
                                        <td>
                                            <label>
                                                Name:</label>
                                        </td>
                                        <td>
                                            <asp:TextBox ID="txtCompanyName" CssClass="input_field ui-corner-all" runat="server"></asp:TextBox>
                                        </td>
                                        <td style="width: 10px;">
                                        </td>
                                        <td>
                                            <label>
                                                Location:</label>
                                        </td>
                                        <td>
                                            <asp:TextBox ID="txtCompanyLocation" CssClass="input_field ui-corner-all" runat="server"></asp:TextBox>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <label>
                                                Start Date:</label>
                                        </td>
                                        <td>
                                            <asp:DropDownList ID="ddlStartMonth" Width="80px" CssClass="select_field ui-corner-all"
                                                runat="server">
                                                <asp:ListItem></asp:ListItem>
                                                <asp:ListItem Value="Jan">Jan</asp:ListItem>
                                                <asp:ListItem Value="Feb">Feb</asp:ListItem>
                                                <asp:ListItem Value="Mar">Mar</asp:ListItem>
                                                <asp:ListItem Value="Apr">Apr</asp:ListItem>
                                                <asp:ListItem Value="May">May</asp:ListItem>
                                                <asp:ListItem Value="Jun">Jun</asp:ListItem>
                                                <asp:ListItem Value="Jul">Jul</asp:ListItem>
                                                <asp:ListItem Value="Aug">Aug</asp:ListItem>
                                                <asp:ListItem Value="Sept">Sept</asp:ListItem>
                                                <asp:ListItem Value="Oct">Oct</asp:ListItem>
                                                <asp:ListItem Value="Nov">Nov</asp:ListItem>
                                                <asp:ListItem Value="Dec">Dec</asp:ListItem>
                                            </asp:DropDownList>
                                            <asp:DropDownList ID="ddlStartYear" Width="110px" CssClass="select_field ui-corner-all"
                                                runat="server">
                                                <asp:ListItem></asp:ListItem>
                                            </asp:DropDownList>
                                        </td>
                                        <td style="width: 10px;">
                                        </td>
                                        <td>
                                            <label>
                                                End Date:</label>
                                        </td>
                                        <td>
                                            <asp:DropDownList ID="ddlEndMonth" Width="80px" CssClass="select_field ui-corner-all"
                                                runat="server">
                                                <asp:ListItem></asp:ListItem>
                                                <asp:ListItem Value="Jan">Jan</asp:ListItem>
                                                <asp:ListItem Value="Feb">Feb</asp:ListItem>
                                                <asp:ListItem Value="Mar">Mar</asp:ListItem>
                                                <asp:ListItem Value="Apr">Apr</asp:ListItem>
                                                <asp:ListItem Value="May">May</asp:ListItem>
                                                <asp:ListItem Value="Jun">Jun</asp:ListItem>
                                                <asp:ListItem Value="Jul">Jul</asp:ListItem>
                                                <asp:ListItem Value="Aug">Aug</asp:ListItem>
                                                <asp:ListItem Value="Sept">Sept</asp:ListItem>
                                                <asp:ListItem Value="Oct">Oct</asp:ListItem>
                                                <asp:ListItem Value="Nov">Nov</asp:ListItem>
                                                <asp:ListItem Value="Dec">Dec</asp:ListItem>
                                            </asp:DropDownList>
                                            <asp:DropDownList ID="ddlEndYear" Width="110px" CssClass="select_field ui-corner-all"
                                                runat="server">
                                                <asp:ListItem></asp:ListItem>
                                            </asp:DropDownList>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="8">
                                            <asp:LinkButton ID="btnAddEmployer" Style="float: right" CssClass="link" runat="server"
                                                OnClick="btnAddEmployer_Click">Add Workplace</asp:LinkButton>
                                        </td>
                                    </tr>
                                </table>
                                <br />
                                <br />
                                <asp:DataList ID="GridEmployers" runat="server">
                                    <ItemTemplate>
                                        <div style="width: 100%">
                                            <span>
                                                <%# DataBinder.Eval(Container.DataItem, "EmployerName")%>,
                                                <%# DataBinder.Eval(Container.DataItem, "Location")%></span>
                                            <br />
                                            <span style="font-size: 11px;">
                                                <%# DataBinder.Eval(Container.DataItem, "EmployementStart")%>
                                                -
                                                <%# DataBinder.Eval(Container.DataItem, "EmploymentEnd")%>
                                            </span>
                                            <asp:ImageButton ID="imgDeleteEmployer" Style="float: right;" wid='<%# DataBinder.Eval(Container.DataItem, "WorkDetailsID")%>'
                                                ImageUrl="../images/Close-icon.png" runat="server" OnClientClick="return confirm('Are you sure?')"
                                                OnClick="imgDeleteEmployer_Click" />
                                            <hr />
                                        </div>
                                    </ItemTemplate>
                                </asp:DataList>
                            </ContentTemplate>
                        </asp:UpdatePanel>
                    </div>
                    <h3>
                        <a href="#">Education</a></h3>
                    <div style="width: 650px;">
                        <asp:UpdatePanel ID="pnlUpdateEducationInfo" runat="server" UpdateMode="Always">
                            <ContentTemplate>
                                <table>
                                    <tr>
                                        <td>
                                            <label>
                                                College:</label>
                                        </td>
                                        <td>
                                            <asp:TextBox ID="txtCollege" CssClass="input_field ui-corner-all" runat="server"></asp:TextBox>
                                        </td>
                                        <td style="width: 10px;">
                                        </td>
                                        <td>
                                            <label>
                                                Specialization:</label>
                                        </td>
                                        <td>
                                            <asp:TextBox ID="txtSpecialization" CssClass="input_field ui-corner-all" runat="server"></asp:TextBox>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <label>
                                                Completion year:</label>
                                        </td>
                                        <td>
                                            <asp:DropDownList ID="ddlCompletionYear" Width="110px" CssClass="select_field ui-corner-all"
                                                runat="server">
                                                <asp:ListItem></asp:ListItem>
                                            </asp:DropDownList>
                                        </td>
                                        <td style="width: 10px;">
                                        </td>
                                        <td>
                                        </td>
                                        <td>
                                        </td>
                                    </tr>
                                </table>
                                <br />
                                <asp:LinkButton ID="btnAddCollege" Style="float: right" CssClass="link" runat="server"
                                    OnClick="btnAddEducation_Click">Add Education</asp:LinkButton>
                                <br />
                                <br />
                                <asp:DataList ID="GridEducation" runat="server">
                                    <ItemTemplate>
                                        <div style="width: 100%">
                                            <span>
                                                <%# DataBinder.Eval(Container.DataItem, "College")%>,
                                                <%# DataBinder.Eval(Container.DataItem, "Specialization")%></span>
                                            <br />
                                            <span style="font-size: 11px;">Passed in
                                                <%# DataBinder.Eval(Container.DataItem, "YearOfCompletion")%>
                                            </span>
                                            <asp:ImageButton ID="imgDeleteEmployer" Style="float: right;" eid='<%# DataBinder.Eval(Container.DataItem, "EducationID")%>'
                                                ImageUrl="../images/Close-icon.png" runat="server" OnClientClick="return confirm('Are you sure?')"
                                                OnClick="imgDeleteCollege_Click" />
                                            <hr />
                                        </div>
                                    </ItemTemplate>
                                </asp:DataList>
                            </ContentTemplate>
                            <Triggers>
                                <asp:AsyncPostBackTrigger ControlID="btnAddCollege" EventName="Click" />
                            </Triggers>
                        </asp:UpdatePanel>
                    </div>
                    <h3>
                        <a href="#">Change Password</a></h3>
                    <div style="width: 650px;">
                        <asp:UpdatePanel ID="pnlChangePassword" runat="server" UpdateMode="Conditional">
                            <ContentTemplate>
                                <table>
                                    <tr>
                                        <td>
                                            <span class="spancls">Old Password:</span>
                                        </td>
                                        <td>
                                            <asp:TextBox ID="txtOldPassword" runat="server" TextMode="Password" CssClass="input_field ui-corner-all"></asp:TextBox>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <label for="author">
                                                New Password:</label>
                                        </td>
                                        <td>
                                            <asp:TextBox ID="txtNewPassword" runat="server" TextMode="Password" CssClass="input_field ui-corner-all"></asp:TextBox>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <label for="author">
                                                Retype New Password:</label>
                                        </td>
                                        <td>
                                            <asp:TextBox ID="txtRetypeNewPassword" runat="server" TextMode="Password" CssClass="input_field ui-corner-all"></asp:TextBox>
                                        </td>
                                    </tr>
                                </table>
                            </ContentTemplate>
                            <Triggers>
                                <asp:AsyncPostBackTrigger ControlID="btnChangePassword" EventName="Click" />
                            </Triggers>
                        </asp:UpdatePanel>
                        <asp:Button ID="btnChangePassword" runat="server" Text="Update" Style="float: right;"
                            OnClick="btnChangePassword_Click" />
                    </div>
                </div>
            </td>
        </tr>
    </table>
    <div>
    </div>
</asp:Content>
